Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stacked Alignment - Use Class Constant Rather than Literal #1716

Merged
merged 5 commits into from
Feb 3, 2021
Merged

Stacked Alignment - Use Class Constant Rather than Literal #1716

merged 5 commits into from
Feb 3, 2021

Conversation

oleibman
Copy link
Collaborator

This is:

- [x] a bugfix (maintainability and coverage)
- [ ] a new feature

Checklist:

Why this change is needed?

PR #1580 defined constants for "stacked" alignment in cells.
Using those constants outside of Style/Alignment was beyond the
scope of the original PR, but I said I would get to it.
This PR replaces all uses of literal -165, and appropriate uses of
literal 255, with the named constants, and adds tests to make sure
that the changed code is covered in the test suite.

PR #1580 defined constants for "stacked" alignment in cells.
Using those constants outside of Style/Alignment was beyond the
scope of the original PR, but I said I would get to it.
This PR replaces all uses of literal -165, and appropriate uses of
literal 255, with the named constants, and adds tests to make sure
that the changed code is covered in the test suite.
src/PhpSpreadsheet/Writer/Xls/Xf.php Outdated Show resolved Hide resolved
src/PhpSpreadsheet/Writer/Xls/Xf.php Outdated Show resolved Hide resolved
src/PhpSpreadsheet/Reader/Xls.php Show resolved Hide resolved
@oleibman oleibman requested a review from MarkBaker February 1, 2021 18:16
src/PhpSpreadsheet/Writer/Xls/Xf.php Outdated Show resolved Hide resolved
src/PhpSpreadsheet/Writer/Xls/Xf.php Show resolved Hide resolved
@oleibman oleibman requested a review from MarkBaker February 2, 2021 17:00
@MarkBaker
Copy link
Member

Code is looking good now, thanks

I know in my more recent code, I'm making a lot more use of class constants, I definitely think it's a much more positive approach than literals, especially when the constants are descriptive in their names

@MarkBaker MarkBaker merged commit 2fac9ee into PHPOffice:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants